﻿using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Models.Common;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using UtilsORM;
using UtilsORM.MySqlData;

////using System.Web.Script.Serialization;

namespace ServiceWeb.DBGateway
{
    public class DBIotDeviceModelFile
    {
        EFYihongIotContext ef = new EFYihongIotContext();
        public string getModelFiles(string mguid,string type)
        {
            List< iot_device_model_file> files= ef.iot_device_model_file.Where(c =>c.f_m_guid==mguid &&  c.f_type==type).ToList();

            string filestr = "";
            foreach(iot_device_model_file file in files)
            {
                if(filestr=="")
                {
                    filestr = file.f_url;
                }
                else
                {
                    filestr = filestr +"," +file.f_url;
                }
            }
            return filestr;
        }

     
    }
}
